package com.bsj.media.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author yinhao
 * @version 1.0
 * @description 端口配置
 * @date 2024/8/12
 */
@Component
public class PortConstant {

    /**
     * RTP直播流端口
     */
    public static Integer rtpPort;
    /**
     * RTP回放开始端口
     */
    public static Integer rtpBackPort;
    /**
     * RTP回放下载开始端口(100个)
     */
//    public static Integer rtpBackDownloadPort;
    /**
     * 客户端链路过来拉流的http端口
     */
    public static Integer httpPort;
    /**
     * 直播回放http地址
     */
    public static String httpPlayBack;

    @Value("${video.rtpPort}")
    public void setRtpPort(Integer rtpPort) {
        PortConstant.rtpPort = rtpPort;
    }

    @Value("${video.rtpBackPort}")
    public void setRtpBackPort(Integer rtpBackPort) {
        PortConstant.rtpBackPort = rtpBackPort;
    }

//    @Value("${video.rtpBackDownloadPort}")
//    public void setRtpBackDownloadPort(Integer rtpBackDownloadPort) {
//        PortConstant.rtpBackDownloadPort = rtpBackDownloadPort;
//    }

    @Value("${video.httpPort}")
    public void setHttpPort(Integer httpPort) {
        PortConstant.httpPort = httpPort;
    }

    @Value("${video.httpPlayBack}")
    public void setHttpPlayBack(String httpPlayBack) {
        PortConstant.httpPlayBack = httpPlayBack;
    }
}
